Declare local variables at the start of a block, not in the middle
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 14 Nov 2005 10:47:38 +0000 (11:47 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 14 Nov 2005 10:47:38 +0000 (11:47 +0100)
(ISO C constraint).

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c

index 5f22d6af66ad1a1ded4d719a3f44c9a5c8a2cd03..fbcaec2c4f7634824d0e79aa64a640620c6d63b6 100644 (file)
@@ -293,17 +293,18 @@ static void connect(struct blkfront_info *info)
 {
        unsigned long sectors, sector_size;
        unsigned int binfo;
+       int err;
 
         if (info->connected == BLKIF_STATE_CONNECTED)
                return;
 
        DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
 
-       int err = xenbus_gather(NULL, info->xbdev->otherend,
-                               "sectors", "%lu", &sectors,
-                               "info", "%u", &binfo,
-                               "sector-size", "%lu", &sector_size,
-                               NULL);
+       err = xenbus_gather(NULL, info->xbdev->otherend,
+                           "sectors", "%lu", &sectors,
+                           "info", "%u", &binfo,
+                           "sector-size", "%lu", &sector_size,
+                           NULL);
        if (err) {
                xenbus_dev_fatal(info->xbdev, err,
                                 "reading backend fields at %s",
@@ -349,10 +350,10 @@ static void blkfront_closing(struct xenbus_device *dev)
 
 static int blkfront_remove(struct xenbus_device *dev)
 {
-       DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
-
        struct blkfront_info *info = dev->data;
 
+       DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
+
        blkif_free(info);
 
        kfree(info);
index 7f4958038b18971a21b013d479a04b7a341a1de1..950dfa8f8cb493ac9af6d543ab961c7887bc5cf1 100644 (file)
@@ -118,10 +118,11 @@ static int netback_hotplug(struct xenbus_device *xdev, char **envp,
        struct backend_info *be = xdev->data;
        netif_t *netif = be->netif;
        int i = 0, length = 0;
+       char *val;
 
        DPRINTK("netback_hotplug");
 
-       char *val = xenbus_read(NULL, xdev->nodename, "script", NULL);
+       val = xenbus_read(NULL, xdev->nodename, "script", NULL);
        if (IS_ERR(val)) {
                int err = PTR_ERR(val);
                xenbus_dev_fatal(xdev, err, "reading script");
index 5d5093d6c306ab8021fad1d4ddc3949d9dad18b5..230f379cddd6bbb6ac36e793a8b74b3e017374e0 100644 (file)
@@ -284,6 +284,7 @@ static void otherend_changed(struct xenbus_watch *watch,
        struct xenbus_device *dev =
                container_of(watch, struct xenbus_device, otherend_watch);
        struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver);
+       XenbusState state;
 
        /* Protect us against watches firing on old details when the otherend
           details change, say immediately after a resume. */
@@ -294,9 +295,10 @@ static void otherend_changed(struct xenbus_watch *watch,
                return;
        }
 
-       XenbusState state = xenbus_read_driver_state(dev->otherend);
+       state = xenbus_read_driver_state(dev->otherend);
 
-       DPRINTK("state is %d, %s, %s", state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
+       DPRINTK("state is %d, %s, %s",
+               state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
 
        drv->otherend_changed(dev, state);
 }